package com.woniu.uums.controller;

import com.woniu.uums.pojo.ZfPoweruser;
import com.woniu.uums.service.ZfPoweruserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: finance021
 * @description:
 * @create: 2024-11-06 17:44
 **/
@RestController
public class LoginController {
    @Autowired
    private ZfPoweruserService zfPoweruserService;

    /**
     * 登录
     *
     * @return
     */
    @PostMapping("/loginByDM")
    public String login(@RequestBody ZfPoweruser poweruser) {
        return zfPoweruserService.login(poweruser.getUsername(), poweruser.getPassword());
    }

    /**
     * 请使用这个登录功能
     *
     * @param poweruser
     * @return
     */
    @PostMapping("/loginByMySQL")
    @ApiOperation(value = "登录", notes = "mysql登录")
    public String loginByMySQL(@RequestBody ZfPoweruser poweruser) {
        return zfPoweruserService.login2(poweruser.getUsername(), poweruser.getPassword());
    }
}
